package com.jy.api.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

/**
 * Created by xiaohua on 2018/11/30.
 */
public class TimeToFormateUtils {


    public static String forMat(String s) {
        String[] source = s.split("-");
        String sou = source[0] + source[1] + source[2];
        String[] sources = sou.split(" ");
        String s1 = sources[0];
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
        simpleDateFormat.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
        String endTime = null;
        try {
            endTime = simpleDateFormat.format(simpleDateFormat.parse(s1));
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return endTime;


    }


}
